local huanhuo_select = fk.CreateSkill {
  name = "#th_huanhuo_select",
}

huanhuo_select:addEffect("active", {
  name = "#th_huanhuo_select",
  card_num = 1,
  card_filter = function(self, player, to_select, selected)
    local card = Fk:getCardById(to_select)
    if #selected == 0 and not player:prohibitDiscard(card) then
      if not self.targets or #self.targets == 0 then
        return card:getTypeString() ~= self.type
      end
      return true
    end
  end,
  max_target_num = 1,
  target_filter = function(self, player, to_select, selected, selected_cards)
    if #selected == 0 and #selected_cards == 1 and Fk:getCardById(selected_cards[1]):getTypeString() == self.type then
      return self.targets and table.contains(self.targets, to_select.id)
    end
  end
})

return huanhuo_select